package cn.zl.GB28181.transmit.event.request.impl;

import cn.zl.GB28181.transmit.SIPProcessorObserver;
import cn.zl.GB28181.transmit.event.request.BaseSIPRequestProcessor;
import cn.zl.GB28181.transmit.event.request.ISIPRequestProcessor;
import cn.zl.config.ZLConfig;
import jakarta.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

import javax.sip.RequestEvent;

/**
 * SIP命令类型： INVITE请求
 */
@Component
public class InviteRequestProcessor extends BaseSIPRequestProcessor implements InitializingBean, ISIPRequestProcessor {

    private final Logger logger = LoggerFactory.getLogger(InviteRequestProcessor.class);

    public final String method = "INVITE";

    @Resource
    private ZLConfig config;
    @Resource
    private SIPProcessorObserver sipProcessorObserver;


    @Override
    public void process(RequestEvent event) {

    }

    @Override
    public void afterPropertiesSet() throws Exception {
        // 添加消息处理的订阅
        sipProcessorObserver.addRequestProcessor(method, this);
    }

}
